<?php
namespace backend\models;



use yii\base\Model;

class UserFrom extends UploadFile
{
//     public $username;  
//    public $pwd;  
//    public $re_pwd;  
//    public $email;  
//    public $bobby;  
//    public $remark;  
//    public $photo;  
//    public $school;  
//    public $info;  
    /**
     * @param参数
     *
     *
     */

    public $goods_name;
    public $pwd;
    public $re_pwd;
    public $email;
    public $bobby;
    public $remark;
    public $photo;
    public $school;
    public $info;

    public static function tableName()
    {
       return '{{%goods}}';
    }

       public function rules()
       {
           return
               [
                       //验证不能为空
                   [['username','pwd','email','bobby'],'required',"message"=>"{attribute}不能为空"],
                   //验证用户唯一
                   ['username', 'unique', 'targetClass' => '\frontend\models\User', 'message' => '用户名已存在.'],
                   //验证密码不一致
                   ['re_pwd', 'compare', 'compareAttribute' => 'pwd', 'message' => '两次密码不一致'],
                   //验证字符串长度
                   [['username'],"string", "max"=>"10", "min"=>"5", "tooLong"=>"{attribute}不能大于10个字符", "tooShort"=>"{attribute}不能小于5个字符"],
                   //采用rules 规则验证
                   ['email', 'email',"message"=>"{attribute}格式错误"],
                   [['remark'], 'string', 'max' => 200],
               ];
       }


       public function attributeLabels()
       {
           return [
                 'user_id'=>'自增id',
                 'pwd'=>'自增id',
                 're_pwd'=>'自增id',
                 'sex'=>'自增id',
                 'email'=>'自增id',
                 'hobby'=>'自增id',
                 'school'=>'自增id',
                 'remark'=>'自增id',
           ];
       }

       /*
        * 文件上传
        *
        */


}